﻿using System;
using System.Collections.Generic;
using SlamCms.Data;

namespace SlamCms.Data
{
	public enum TagTreeNodeType
	{ 
		Root,
		TagCategory,
		Tag,
		Special
	}

	[Serializable]
	public class TagTreeNode : ICloneable
	{
		public TagTreeNode()
		{
			this.Children = new List<TagTreeNode>();
			this.Identifiers = new string[] { };
			this.Attributes = new Dictionary<string, object>();
		}

		public string Id { get; set; }
		public string Text { get; set; }
		public IDictionary<string, object> Attributes { get; private set; }

		public string Url { get; set; }
		public bool IsSelected { get; set; }
		public int ContentItemCount { get; set; }

		public string Identifier { get; set; } 
		public string[] Identifiers { get; set; }

		public int Depth { get; set; }
		public TagTreeNodeType Type { get; set; }
		public virtual Tag Tag { get; set; }
		public virtual TagCategory TagCategory { get; set; }
		public virtual TagTreeNode Parent { get; set; }
		public IList<TagTreeNode> Children { get; set; }

		public object Clone()
		{
			return this.MemberwiseClone();
		}
	}
}
